﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;
using UIT.ScrumTool.Client.Controller;
using UIT.ScrumTool.Client.ControlService;

namespace UIT.ScrumTool.Client.Utilities.StoryTaskGridView
{
    public class StoryTaskShow
    {
        private int id;
        private string subject;
        private string description;
        private float estimateStoryPoint;
        private float estimateDuration;
        private int important;
        private List<UIT.ScrumTool.Client.ControlService.TaskDto>lstTask;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public string Subject
        {
            get { return subject; }
            set { subject = value; }
        }

        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        public float EstimateStoryPoint
        {
            get { return estimateStoryPoint; }
            set { estimateStoryPoint = value; }
        }

        public float EstimateDuration
        {
            get { return estimateDuration; }
            set { estimateDuration = value; }
        }

        public int Important
        {
            get { return important; }
            set { important = value; }
        }

        public List<TaskDto> LstTask
        {
            get { return lstTask; }
            set { lstTask = value; }
        }

        public static StoryTaskShow CreateStoryTaskShow(TaskDto taskDto)
        {
            StoryTaskShow storyTaskShow = new StoryTaskShow();
            storyTaskShow.Id = taskDto.Id;
            storyTaskShow.Subject = taskDto.Subject;
            storyTaskShow.Description = taskDto.Description;
            storyTaskShow.Important = taskDto.Importance;
            storyTaskShow.EstimateStoryPoint = taskDto.EstmatedStoryPoint;
            storyTaskShow.EstimateDuration = taskDto.EstimatedDuration;

            //// Get Task List
            List<TaskDto> lstTask = TaskCtrl.TaskGetByParentId(taskDto.Id);
            storyTaskShow.LstTask = lstTask;
            return storyTaskShow;
        }
    }

    
}
